#pragma once

#include "sql/stmt/stmt.h"
#include "common/lang/string.h"

class Db;

/**
 * @brief 表示删除表的语句
 * @ingroup Statement
 */
class DropTableStmt : public Stmt {
public:
    explicit DropTableStmt(const string &table_name)
      : table_name_(table_name) {}
    virtual ~DropTableStmt() = default;

    StmtType type() const override { return StmtType::DROP_TABLE; }

    const string &table_name() const { return table_name_; }

    // 根据解析后的 SQL 节点构造 DropTableStmt 实例
    static RC create(Db *db, const DropTableSqlNode &drop_table, Stmt *&stmt);

private:
    string table_name_;
};